﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DC.Serialization.Demo.Client
{
    class Program
    {
        static void Main(string[] args)
        {
            //SerializationReference.ContractClient proxy = new SerializationReference.ContractClient();

            //SerializationReference.Contact contact = new SerializationReference.Contact();
            //contact.FirstNamek__BackingField = "Jun";

            //SerializationReference.Customer customer = new SerializationReference.Customer();
            //customer.Companyk__BackingField = "Rovi";

            //SerializationReference.Address address = proxy.GetAddressByFirstName(contact);
            //contact = proxy.GetContactByCompanyName(customer);

            //Console.WriteLine(String.Format("Country: {0} \n Province: {1} \n City: {2} \n Street: {3}", 
            //                                                            address.Countryk__BackingField, 
            //                                                            address.Provincek__BackingField, 
            //                                                            address.Cityk__BackingField, 
            //                                                            address.Streetk__BackingField));

            //Console.WriteLine(String.Format("FirstName: {0} \n LastName: {1} \n PhoneNumber: {2}", 
            //                                                            contact.FirstNamek__BackingField,
            //                                                            contact.LastNamek__BackingField, 
            //                                                            contact.PhoneNumberk__BackingField));

            //Console.ReadKey();



            EventReference.ServiceContractClient proxy = new EventReference.ServiceContractClient();

            EventReference.Address address = new EventReference.Address();
            EventReference.Contact contact = new EventReference.Contact();

            Console.WriteLine(String.Format("Country:{0}\n\nProvince:{1}\n\nStreet:{2}", address.Country, address.Province, address.Street));
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.WriteLine(String.Format("FirstName:{0}\n\nLastName:{1}\n\nPhoneNumber:{2}", contact.FirstName, contact.LastName, contact.PhoneNumber));
            Console.WriteLine("----------------------------------------------------------------------------");
            address.Country = "China";
            address.Province = "JangXi";
            //address.City = "JiuJiang";
            address.Street = "ChangHong Road";

            contact.Address = address;
            contact.FirstName = "Jun";
            contact.LastName = "Hu";
            contact.PhoneNumber = "13816006002";
            //contact.CarNumber = "G88888";

            address= proxy.GetAddress(address);
            contact = proxy.GetContact(contact);

            Console.WriteLine(String.Format("Country:{0}\n\nProvince:{1}\n\nStreet:{2}", address.Country, address.Province, address.Street));
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.WriteLine(String.Format("FirstName:{0}\n\nLastName:{1}\n\nPhoneNumber:{2}", contact.FirstName, contact.LastName, contact.PhoneNumber));

            Console.ReadKey();
        }
    }
}
